package com.oocl.sc.service.impl;

import java.util.List;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.oocl.sc.dao.SmenuDao;
import com.oocl.sc.dao.impl.SmenuDaoImpl;
import com.oocl.sc.entity.Smenu;
import com.oocl.sc.service.SmenuService;
import com.oocl.sc.util.JSONUtil;

public class SmenuServiceImpl implements SmenuService{

	private SmenuDao smenuDao = new SmenuDaoImpl();
	
	public List<Smenu> loadAllMenu() {
		return smenuDao.loadAllMenu();
	}
	
	public String loadAllMenuToJSON(){
		String json = "";
		try {
			List<Smenu>	smenus = this.loadAllMenu();
			json = JSONUtil.ObjToStr(smenus);
		} catch (JsonProcessingException e) {
			e.printStackTrace();
		}
		return json;
	}
	
}
